From: Kenichi Handa Date: Thu, 15 Jan 2004 11:31:37 +0000 (+0000) Subject: (Freplace_match): Use make_multibyte_string or X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~24489 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=097dd20cb3103bb0de9b10c2795eba6b228d5f5d;p=emacs.git (Freplace_match): Use make_multibyte_string or make_unibyte_string according to the buffer multibyteness. --- diff --git a/src/search.c b/src/search.c index 538cb8dfa64..020573b75a1 100644 --- a/src/search.c +++ b/src/search.c @@ -2553,8 +2553,16 @@ since only regular expressions have distinguished subexpressions. */) } if (really_changed) - newtext = make_string (substed, substed_len); + { + if (buf_multibyte) + { + int nchars = multibyte_chars_in_text (substed, substed_len); + newtext = make_multibyte_string (substed, nchars, substed_len); + } + else + newtext = make_unibyte_string (substed, substed_len); + } xfree (substed); }